﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SampleCard.aspx.cs" Inherits="PPAP.Web.Part.SampleCard" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body style="font-family: Arial, Helvetica, sans-serif;">
    <form id="form1" runat="server">
    <div>
        <table width="100%">
            <tr>
                <td align="right">
                    <input type="button" onclick="javascript:add()" id="btnAdd" runat="server" class="button"
                        value="Add" />
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="GridView1" runat="server" CellPadding="4" Width="100%" ForeColor="#333333"
                        GridLines="None" AutoGenerateColumns="False">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:TemplateField HeaderText="SN" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%#Eval("rownum") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Sample card No." ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%#Eval("SAMPLECARDNO").ToString()==""?"":"SC-"+Eval("SAMPLECARDNO") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" Width="100px"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Department" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%#Eval("testitemname") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Dept.rep" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:Label ID="Label4" runat="server" Text='<%#Eval("DEPTREP") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Status" ItemStyle-Width="102px" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:Label ID="Label5" runat="server" Text='<%#Status(Eval("STATUS").ToString()) %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Result" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:Image ID="Image1" Visible='<%#Eval("RESULT").ToString()==""?false:true %>' ImageUrl='<%#"~/Part/image/"+Eval("RESULT")+".png" %>'
                                        runat="server" />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Start time" ItemStyle-Width="105px" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:Label ID="Label7" runat="server" Text='<%#Eval("STARTTIME").ToString()==""?"":DateTime.Parse(Eval("STARTTIME").ToString()).ToString("yyyy/MM/dd")  %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="End time（planned）" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:Label ID="Label8" runat="server" Text='<%#Eval("ENDTIMEPLAN").ToString()==""?"":DateTime.Parse(Eval("ENDTIMEPLAN").ToString()).ToString("yyyy/MM/dd")  %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="End time （actual）" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:Label ID="Label9" runat="server" Text='<%#Eval("ENDTIMEACTUAL").ToString()==""?"":DateTime.Parse(Eval("ENDTIMEACTUAL").ToString())>DateTime.Parse("1900-02-01")?DateTime.Parse(Eval("ENDTIMEACTUAL").ToString()).ToString("yyyy/MM/dd"):""  %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Action" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:ImageButton ID="ImageButton1" ToolTip="Print" PostBackUrl='<%#"javascript:print("+Eval("ID")+")" %>'
                                        Visible='<%#Eval("Status").ToString()=="9"?false:true %>' Width="22" ImageUrl="../Images/newimg/printer.png"
                                        runat="server" />
                                    <asp:ImageButton ID="ImageButton2" ToolTip="Log file" ImageUrl="../Images/newimg/search.png"
                                        runat="server" PostBackUrl='<%#"javascript:show("+Eval("ID")+")" %>' />
                                    <img id="imgT" runat="server" onclick='<%#"javascript:del("+Eval("ID")+")" %>' src="~/Images/newimg/delete.png"
                                        visible='<%#Eval("Status").ToString()=="9"?false:true %>' title="Termination" />
                                    <img id="imgE" runat="server" onclick='<%#"javascript:edit("+Eval("TESTDEPARTMENTID")+")" %>'
                                        src="~/Images/newimg/write.png" visible='<%#Eval("Status").ToString()=="0"?true:false %>'
                                        title="Edit" />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" Wrap="false"></ItemStyle>
                            </asp:TemplateField>
                        </Columns>
                        <EditRowStyle BackColor="#2E8AC5" />
                        <FooterStyle BackColor="#507CD1" ForeColor="White" />
                        <HeaderStyle BackColor="#E7E8E8" ForeColor="#000000" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                    </asp:GridView>
                </td>
            </tr>
            <tr runat="server" id="tr">
                <td>
                    <hr />
                    <table style="margin-top: 10px;" width="100%">
                        <tr>
                            <td style="font-weight: bold; color: #2E8AC5;">
                                Remark
                            </td>
                        </tr>
                        <tr style="height: 28px;">
                            <td>
                                <img src="image/G.png" alt="" style=" vertical-align: middle;" />100% accetable for customer
                            </td>
                        </tr>
                        <tr style="height: 28px;">
                            <td>
                                <img src="image/Y.png" alt="" style=" vertical-align: middle;" />Suitable for customer
                            </td>
                        </tr>
                        <tr style="height: 28px;">
                            <td>
                                <img src="image/R.png" alt="" style=" vertical-align: middle;" />Not Suitable for customer
                            </td>
                        </tr>
                    </table>
                    <hr />
                </td>
            </tr>
        </table>
    </div>
    <script language="javascript" type="text/javascript">
        function add() {
            url = "SampleCardAdd.aspx?rid=<%=RID %>";
            PopUpWindow(url, 230, 160, 730, 520);
        }
        function edit(id) {
            url = "SampleCardAdd.aspx?rid=<%=RID %>&id=" + id;
            PopUpWindow(url, 230, 160, 730, 520);
        }
        function show(id) {
            url = "SampleCardLog.aspx?sid=" + id;
            PopUpWindow(url, 230, 160, 730, 520);
        }
        function print(id) {
            url = "SampleCardPrint.aspx?id=" + id;
            PopUpWindow(url, 230, 60, 830, 720);
        }
        function del(id) {
            if (confirm('Are you sure you want to Termination?')) {
                url = "SampleCard.aspx?rid=<%=RID %>&sid=" + id;
                window.location.href = url;
            }
        }
    </script>
    </form>
</body>
</html>
